<!DOCTYPE html>
<html lang="en">
<head th:insert="/admin/common/head::css"></head>
<body>
<div th:insert="/admin/common/header::header" ></div>
<!--  main  -->
<div class="container-fluid">
    <div class="row-fluid">
        <div th:insert="/admin/common/side::side" ></div>
        <!-- content  内容页面的代码放这里 -->
        <div class="block">
            <div class="block-content collapse in">
                <div class="span12">
                    <form class="form-horizontal" method="post" th:action="@{/admin/active/update}">
                        <fieldset>
                            <legend>活动信息修改</legend>

                            <div class="control-group" th:if="${active != null}">
                                <label class="control-label">活动序号</label>
                                <div class="controls">
                                    <input readonly="readonly" required type="text" class="input-xlarge datepicker" id="id" name="id" th:value="${active!=null?active.id:''}">
                                </div>
                            </div>

                            <div class="control-group">
                                <label class="control-label" >活动名称</label>
                                <div class="controls">
                                    <input th:readonly="${loginUser.userType == 1}" required type="text" class="input-xlarge datepicker" id="name" name="name" th:value="${active!=null?active.name:''}">
                                </div>
                            </div>

                            <div class="control-group">
                                <label class="control-label" >活动类型</label>
                                <div class="controls">
                                    <select th:readonly="${loginUser.userType == 1}" th:value="${active != null?active.tid:''}" name="tid" id="tid" class="form-control1">
                                        <option th:selected="${active != null ? active.tid == type.id: ''}" th:each="type:${types}" th:value="${type.id}" th:text="${type.name}"></option>
                                    </select>
                                </div>
                            </div>

                            <div class="control-group">
                                <label class="control-label" >活动地址</label>
                                <div class="controls">
                                    <input th:readonly="${loginUser.userType == 1}" required type="text" class="input-xlarge datepicker" id="address" name="address" th:value="${active!=null?active.address:''}">
                                </div>
                            </div>

                            <div class="control-group">
                                <label class="control-label" >活动时间</label>
                                <div class="controls">
                                    <input th:readonly="${loginUser.userType == 1}" required type="date" class="input-xlarge datepicker" id="time" name="time" th:value="${active!=null?#dates.format(active.time, 'yyyy-MM-dd'):''}">
                                </div>
                            </div>

                            <div class="control-group">
                                <label class="control-label" >活动内容</label>
                                <div class="controls">
                                    <input th:readonly="${loginUser.userType == 1}" required type="text" class="input-xlarge datepicker" id="content" name="content" th:value="${active!=null?active.content:''}">
                                </div>
                            </div>


                            <div class="control-group" th:if="${active != null}">
                                <label class="control-label" >发布人</label>
                                <div class="controls">
                                    <input readonly="readonly" required type="text" class="input-xlarge datepicker" th:value="${active!=null?active.user.username:''}">
                                </div>
                            </div>

                            <HR align=center width=300 color=#987cb9 SIZE=1>

                            <div th:if="${loginUser.userType == 1}" class="control-group" >
                                <label class="control-label" >报名说明</label>
                                <div class="controls">
                                    <textarea rows="10" cols="50" name="comment">
                                       [[ ${app!=null?app.comment:''} ]]
                                    </textarea>
                                </div>
                            </div>


                            <div class="form-actions">
                                <button th:if="${loginUser.userType == 0}" type="submit" class="btn btn-primary"  >[[ ${active!=null?'更新':'新增'} ]]</button>
                                <button th:if="${loginUser.userType == 1}" type="submit" class="btn btn-primary"  th:type="${(loginUser.userType == 1 && app!=null)?'button':'submit'}" th:value="${app!=null?app.status:'报名'}">[[ ${app!=null?app.status:'报名'} ]]</button>
                                <a type="button" class="btn btn-warning" th:href="@{/admin/active/page}">返回</a>
                            </div>
                        </fieldset>
                    </form>

                </div>
            </div>
        </div>
        <!-- content -->
    </div>
</div>
<!--  main  -->

</body>
<div th:insert="/admin/common/footer::js" ></div>
<script type="text/javascript">

    document.getElementById("active").className = 'active'
</script>
</html>